#!/bin/bash

function name(){
	for n in $@
	do	
		echo $n
	done
}

name "oj" "bk" "yes"

test(){
	sum=0		
	while read n 
	do
		if ((n<0)); then
			break;
		elif ((n>100)); then
			((sum+=100))
		else
			((sum+=n))
		fi
	done
	# return $sum shell中return不是用来返回运行结果的,而是返回退出状态
	echo "$sum" # 通过echo或者printf来返回,在外部使用``或者$()来获取结果
}

result=$(test)

function getresult(){
	echo "result is $@" 
}

getresult $result
